package com.oracle.lingshangejia.adapter;

import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.oracle.lingshangejia.R;
import com.oracle.lingshangejia.bean.SeekMedicineBean;

import java.util.List;

public class HomeAdapter extends BaseQuickAdapter<SeekMedicineBean.DataBean,BaseViewHolder>/*RecyclerView.Adapter<HomeAdapter.VH> */{
    public HomeAdapter( @Nullable List<SeekMedicineBean.DataBean> data) {
        super(R.layout.home_item, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, SeekMedicineBean.DataBean item) {
                 helper.setText(R.id.tv_title,item.getWtbt() );
    }

 /*   public HomeAdapter() {
    }

    @Override
    public void onBindViewHolder(@NonNull HomeAdapter.VH vh, int i) {

    }

    @Override
    public int getItemCount() {
        return 5;
    }

    @Override
    public VH onCreateViewHolder(ViewGroup parent, int viewType) {
        //LayoutInflater.from指定写法
        View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.home_item, parent, false);
        return new VH(v);
    }
    //② 创建ViewHolder
    public static class VH extends RecyclerView.ViewHolder{
        public final TextView title;
        public VH(View v) {
            super(v);
            title = (TextView) v.findViewById(R.id.title);
        }
    }*/
}
